package com.poizon.utils;

import java.util.Calendar;
import java.util.Date;

/**
 * @ClassName DateUtils
 * @Author NoCheng
 * @Date 2022/1/3 16:02
 * @Description:TODO
 */

public class DateUtils {

    /**
     * 获取指定年后的日期*/
    public static Date getYearTime(int year){
        //1.日历类
        Calendar calendar=Calendar.getInstance();
        //2.添加指定的年
        calendar.add(Calendar.YEAR,year);
        return calendar.getTime();
    }

    /**
     * 测试用*/
    public static Date getTime(){
        //1.日历类
        Calendar calendar=Calendar.getInstance();
        //2.添加指定的年
        calendar.add(Calendar.SECOND, 60 * 60 * 24 * 15);
        return calendar.getTime();
    }
}
